Passed
Pull Request — master (#2)
by André
01:32
created

input.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
dl 0
loc 4
rs 10
nop 2
1
'use strict'
2
3
module.exports = (input, callback) => {
4
	const mqtt = require('mqtt')
0 ignored issues
show
Unused Code introduced by
The constant mqtt seems to be never used. Consider removing it.
Loading history...
5
	const validate = require('./validate')
6
	let error = null
7
	let output = null
0 ignored issues
show
Unused Code introduced by
The assignment to output seems to be never used. If you intend to free memory here, this is not necessary since the variable leaves the scope anyway.
Loading history...
8
9
	validate(input, (validatedInput, thrownError) => {
10
		input = validatedInput
11
		error = thrownError
12
	})
13
14
	output = {
15
		'version': {'ref': 'input'},
16
		'metadata': [
17
			{'name': 'topic', 'value': 'Hulk Hogan'},
18
			{'name': 'timestamp', 'value': Date.now().toString()}
19
		]
20
	}
21
22
23
	callback(error, output, source)
0 ignored issues
show
Bug introduced by
The variable source seems to be never declared. If this is a global, consider adding a /** global: source */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
24
}
25